﻿using SmartSpace.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SmartSpace.Organization
{
    public class Node : ICodeEntity
    {
        public Guid Id { get; set; }
        /// <summary>
        /// 代码
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 全称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 简称
        /// </summary>
        public string ShortName { get; set; }
        /// <summary>
        /// 完成代码 {parentcode}.{code}
        /// </summary>
        public string FullCode { get; set; }
        /// <summary>
        /// 完整路径  {parentname}\{parentname}\{name}
        /// </summary>
        public string Path { get; set; }
        /// <summary>
        /// 机构类型
        /// </summary>
        public Guid TypeId { get; set; }
        public NodeType Type { get; set; }

        public List<Node> Children { get; set; }
        public Node Parent { get; set; }
        public Guid? ParentId { get; set; }

        public string Description { get; set; }

        public int SortIndex { get; set; }

        public void Validation()
        {
        }
    }
}
